<h3><B>公告列表</B></h3>
<div class="form-group">
    <label class="control-label" for="textinput">小区:</label>
    <select ng-model="communityId" ng-options="m.objId as m.communityName for m in communityLabelList.data"
            ng-change="getNoticeList(communityId)">
        <option value="">-- 请选择 --</option>
    </select>

    <button class="btn btn-default btn-xs" style="margin-left: 50px" ng-click="addNoticeRoute()">添加公告</button>
</div>

<div class="tab-content">
    <div class="tab-pane active" id="tab_a">
        <table class="table table-condensed">
            <thead>
            <tr>
                <th>小区</th>
                <th>标题</th>
                <th>创建时间</th>
                <th align="right">操作</th>
            </tr>
            </thead>
            <tbody>
            <tr ng-repeat="notice in noticeList">

                <td>{{notice.community.communityName}}
                <span ng-repeat="c in notice.community">
                    <p>{{c.communityName}}</p>
                </span>
                </td>
                <td>{{notice.title}}</td>
                <td>{{notice.dateCreated | date:'yyyy-MM-dd HH:mm:ss'}}</td>
                <td>
                    <a class="btn btn-secondary btn-xs" ng-click="editNotice(notice.objId)">编辑</a>
                    <a type="button" class="btn btn-secondary btn-xs"
                       ng-click="previewNotice(notice.url)">预览</a>
                    <a ng-show="notice.isValid == false" type="button" class="btn btn-secondary btn-xs"
                       ng-click="setNoticeStatus(notice.objId,true)">发布</a>
                    <a ng-show="notice.isValid == true||notice.isValid == null" type="button" class="btn btn-secondary btn-xs"
                       ng-click="setNoticeStatus(notice.objId,false)">取消发布</a>
                    <a class="btn btn-danger btn-xs" ng-click="deleteNotice(notice.objId)">删除</a>
                    <a class="btn btn-default btn-xs" ng-show="notice.isFresh != true"
                       ng-click="addNoticeToNews(notice.community.objId,notice.objId)">添加到新鲜事</a>
                    <a ng-show="notice.isFresh == true">已在新鲜事</a></td>
            </tr>
            </tbody>
        </table>
    </div>
</div>

<div class="modal fade" id="qrDiv">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
                        aria-hidden="true">&times;</span></button>
                <h4 class="modal-title">二维码：</h4>
            </div>
            <div id="qrBody" class="modal-body">
                <div id='qrcodeCanvas'></div>
            </div>
            <div class="modal-footer">
                <button type="button"
                        class="btn btn-default btn-sm" data-dismiss="modal">关闭
                </button>
            </div>
        </div>
    </div>
</div>